package com.zpark;

import javax.servlet.*;
import java.io.IOException;

/**
 * 创建自定义Servlet的三种方式：
 *      1、实现Servlet接口
 *      2、继承HttpServlet
 *      3、继承GenericServlet
 */
public class Demo01Servlet implements Servlet {
	@Override
	public void init(ServletConfig servletConfig) throws ServletException {
		System.out.println("Servlet初始化，创建Servlet对象");
	}

	@Override
	public ServletConfig getServletConfig() {
		return null;
	}

	@Override
	public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
		System.out.println("Servlet被调用了");
	}

	@Override
	public String getServletInfo() {
		return null;
	}

	@Override
	public void destroy() {
		System.out.println("Servlet对象被销毁了");
	}
}
